const { Rule, LinValidator } = require('../../core/lin-validator-v2')

class wxLoginCode extends LinValidator {
    constructor() {
        super()
        this.code = [
            new Rule('isLength', 'code不能为空', {
                min: 1
            })
        ]
    }
}

class wxUserInfo extends LinValidator {
    constructor() {
        super()
        this.encryptedData = [
            new Rule('isLength', 'encryptedData不能为空', {
                min: 1
            })
        ]
        
        this.iv = [
            new Rule('isLength', 'iv不能为空', {
                min: 1
            })
        ]

        this.sessionKey = [
            new Rule('isLength', 'sessionKey不能为空', {
                min: 1
            })
        ]
    }
}

module.exports = {
    wxLoginCode,
    wxUserInfo
}
